import PropTypes from 'prop-types'
import React, { memo } from 'react'
import RoomItem from '../room-item'
import { RoomWrapper } from './style'

const SectionRooms = memo((props) => {
  const {roomList, roomWidth} = props
  return (
    <RoomWrapper>
      <ul className='room-list'>
        { 
          roomList?.slice(0, 8).map(item => {
            return <RoomItem key={item.id} itemData={item} roomWidth={roomWidth}></RoomItem>
          })
        }
      </ul>
    </RoomWrapper>
  )
})

SectionRooms.propTypes = {
  roomList: PropTypes.array,
  roomWidth: PropTypes.string
}

export default SectionRooms